#ifndef RAID_H
#define RAID_H

struct target_dev;
struct mapped_device;
struct Target_Scsi_Cmnd_t ;
struct raid_restrictions;

struct raid_restrictions {
    unsigned int        max_sectors;
    unsigned short        max_phys_segments;
    unsigned short        max_hw_segments;
    unsigned short        hardsect_size;
    unsigned int        max_segment_size;
    unsigned long        seg_boundary_mask;
    unsigned char        no_cluster; /* inverted so that 0 is default */
};

struct raid_data {
    char *path;
    unsigned int dev;
    struct block_device *bdev;
    struct list_head list;
    
    struct raid_restrictions rs;
    int (* make_request)(struct Target_Scsi_Cmnd_t *cmnd, int rw);
};

int lookup_raid(const char *path, unsigned int  *dev);
int open_raid(struct target_dev *td, unsigned int dev, struct mapped_device *md);
int close_raid(struct target_dev *td);
int check_device_area(struct target_dev *td, sector_t start, sector_t len);

#endif

